package com.flashcash.solu.common.network;

import com.flashcash.solu.bean.RecordFilesResponse;
import com.flashcash.kotlin.data.BasicAck;
import com.flashcash.kotlin.data.OcrResultBean;

import okhttp3.MultipartBody;
import okhttp3.ResponseBody;
import retrofit2.Call;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Multipart;
import retrofit2.http.PUT;
import retrofit2.http.Part;
import retrofit2.http.Query;
import rx.Observable;

public interface FileUploadApi {

    @Multipart
    @PUT("record/files")
    Call<ResponseBody> uploadPhoto(
            @Part MultipartBody.Part photoFile,
            @Query("fileType") String fileType,
            @Header("X-AUTH-TOKEN") String token
    );


    @Deprecated
    @Multipart
    @PUT("loanapp/contract/video")
    Call<ResponseBody>  uploadVideo(@Part MultipartBody.Part videoFile,
                                          @Query("loanAppId") String loanAppId,
                                          @Query("fileType") String fileType,
                                          @Header("X-AUTH-TOKEN") String token);

    @Deprecated
    @GET("record/files")
    Observable<RecordFilesResponse> recordFiles(@Header("X-AUTH-TOKEN") String token);

    @Multipart
    /*@PUT("/loanapp/verify/face") face++*/
    @PUT("/loanapp/verify/yitu") // 依图
    Observable<BasicAck> faceVerify(@Query("loanType") String loanType,
                                    @Query("amount") double amount,
                                    @Query("period") int period,
                                    @Query("periodUnit") String periodUnit,
                                    @Part MultipartBody.Part imageBest,
                                    @Part MultipartBody.Part imageEnv, 
                                    @Part MultipartBody.Part delta,
                                    @Query("imei") String imei,
                                    @Query("productId") long productId,
                                    @Header("X-AUTH-TOKEN") String token);

    @Multipart
    @PUT("/record/ocr")
    Observable<OcrResultBean> idOcr(@Part MultipartBody.Part file, @Header("X-AUTH-TOKEN") String token);
}